//引入路由组件
import HomeIndex from '@/views/home/HomeIndex.vue'
import LoginIndex from "@/views/login/LoginIndex.vue";
import RegisterIndex from "@/views/register/RegisterIndex.vue";
import HelpItemsIndex from "@/views/helpItems/HelpItemsIndex.vue";
import OrderDetailIndex from "@/views/detail/OrderDetailIndex.vue";
import addOrderIndex from "@/views/addOrder/AddOrderIndex.vue";
import MyOrderIndex from "@/views/myOrder/MyOrderIndex.vue";
import ChatIndex from "@/views/chat/ChatIndex.vue";
import ReceiveOrderIndex from "@/views/receiveOrder/ReceiveOrderIndex.vue";
import UserInfoIndex from "@/views/userInfo/UserInfoIndex.vue";
import SecondIndex from "@/views/secondHandMarket/SecondIndex.vue";
//配置路由
export default[
        {
            path: "/home",
            component: HomeIndex,
            meta: {show: true ,search:true ,title:'主页'}
        },
        {
            path: "/login",
            component: LoginIndex,
            meta: {show: false, title:'登录'}
        },
        {
            path: "/register",
            component: RegisterIndex,
            meta: {show: false, title: '注册'}
        },
        {
            path: "/helpItems",
            name: "helpItems",
            component: HelpItemsIndex,
            meta: {show: true, title: '求助列表'}
        },
        {
            path: "/addOrder",
            name: "addOrder",
            component: addOrderIndex,
            meta: {show: true, title: '发起订单'}
        },
        {
            path: '/chat',
            name: 'Chat',
            component: ChatIndex,
            meta: {show: true, title:'在线聊天'}
        },

    {
            path: '/myOrder',
            component: MyOrderIndex,
            meta: {show: true ,search: false, title: '我的订单'},
            children: [
                //重定向
                {
                    path: '/myOrder',
                    redirect: '/myOrder/myInitiate',
                },
                {
                path: 'myInitiate',
                component: () => import('@/views/myOrder/MyAddOrder.vue'),
                    meta: {show: true ,search: false, title:'我的求助订单'},
            },
            {
                path: 'mySnapshotOrder',
                component: () => import('@/views/myOrder/MyHelpOrder.vue'),
                meta: {show: true ,search: false, title:'我的帮助订单'},
            }]
        },
        {
            path: '/detail/:userId',
            component: OrderDetailIndex,
            meta: {show: true ,search:false, title: '订单详情'}
        },
        {
            path: '/receive',
            name: 'receive',
            component: ReceiveOrderIndex,
            meta: {show: true ,search:false, title: '订单交易状态'}
        },
        {
            path: '/userInfo',
            component: UserInfoIndex,
            meta: {show: true ,search:false, title: '用户信息'}
        },
        {
            path: '/secondHandMarket',
            name: 'secondHandMarket',
            component: SecondIndex,
            meta: {show: true ,search:false, title: '二手市场'}
        },
        //重定向
        {
            path: "*",
            redirect: "/home"
        }
    ]
